//
//  DemoDialogViewController.m
//  EZJFastAlertView
//
//  Created by Easy233 on 15/12/25.
//  Copyright © 2015年 wallen. All rights reserved.
//

#import "DemoDialogViewController.h"
#import "EZJFastDialogView.h"

@interface DemoDialogViewController ()

@end

@implementation DemoDialogViewController{
    EZJFastDialogView *dialogView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view setBackgroundColor:[UIColor whiteColor]];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    NSLog(@"touch...");
    dialogView=[[EZJFastDialogView alloc] init];
    [dialogView onDisplayDialogView:^(UIView *view) {
        UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 100, 50)];
        [btn setBackgroundColor:[UIColor orangeColor]];
        [btn setTitle:@"取消" forState:UIControlStateNormal];
        btn.center=view.center;
        [view addSubview:btn];
        [btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
    }];
    
    [dialogView setdialogViewWithWidth:250 dialogViewHeight:300];  //设置页面居中相对显示坐标
    
    //    [dialogView onTouchBGClose:^{       //点击背景消失
    //        NSLog(@"点击背景消失");
    //    }];
    
    [dialogView onClose:^{
        NSLog(@"消失");
    }];
    
    [self.view addSubview:dialogView];
}

- (void)btnClick{
    [dialogView close];
}
@end
